# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=malwasm
pkgver=0.2
pkgrel=8
pkgdesc="Offline debugger for malware's reverse engineering."
url='https://code.google.com/p/malwasm/'
license=('GPL2')
arch=('any')
groups=('blackarch' 'blackarch-reversing' 'blackarch-debugger')
depends=('python2' 'python2-psycopg2' 'python2-flask' 'python2-progressbar'
         'cuckoo' 'postgresql')
optdepens=('pintool')
source=("https://malwasm.googlecode.com/files/$pkgname-v$pkgver.tar.gz"
        "$pkgname.install")
sha512sums=('4006e8cdd181a94306bf2dee25631394c2284cac'
            'd260b3d1f89586c817650aeecbddf7eb026cf1cf')
install="$pkgname.install"

package() {
  cd "$pkgname-v$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python2 web/malwasm_web.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

